<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.link{
				display: block;
				width: 100px;
				height: 100px;
				background-color: orange;
			}
		</style>
	</head>
	<body>
		<a href="http://www.baidu.com" class="link" target="_blank">
			<div class="inner">
				点击
			</div>
		</a>
		<script type="text/javascript">
			var inner = document.getElementsByClassName('inner')[0];
			// 比如一些小图标我们并不想点击时跳转页面，就需要这么写
			inner.addEventListener('click', function(e){
				var e = e || window.event;
				
				e.preventDefault();
				console.log(1)
			})
		</script>
	</body>
</html>
